import { axios } from '@/utils/request';
let uri = process.env.NODE_ENV === 'production' ? '' : '/yb'


const api = {
  userLogin: '/login/login',
  userLogout: '/login/logout',
  userInfo: '/user/get',
  infoUpdate: '/user/info/update'
};

// 辉云兄 测试登录
export function userLogin(data) {
  return axios({
    url: api.userLogin,
    method: 'post',
    data,
    interceptorErr: false
  });
}

export function userLogout(data) {
  return axios({
    url: api.userLogout,
    method: 'put',
    data
  });
}

// userInfo
export function userInfo(id, params) {
  return axios({
    url: `${api.userInfo}/${id}`,
    method: 'get',
    params
  });
}

// infoUpdate
export function infoUpdate(data) {
  return axios({
    url: api.infoUpdate,
    method: 'put',
    data
  });
}

/**
 * choicePositionLogin func
 * data: {
 *     deptId: '',
 *     positionId: ''
 * }
 * @param {Object} data
 * @returns {*} 
 */
export function choicePositionLogin(data) {
  return axios({
    url: '/login/choicePositionLogin',
    method: 'post',
    data
  })
}



